package com.woniuxy.userapp.client.valid;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 日期格式校验
 * @Author xiaogc 自定义参数校验日期类
 * @Date 2020/9/15
 */
@Documented
@Constraint(validatedBy = { DateFormatValidator.class })
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface DateFormat {
    String message() default "";

    String pattern();

    // 这两行不加会报错 javax.validation.ConstraintDefinitionException: HV000074
    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
